package cn.xo68.boot.qrcode;

import cn.xo68.boot.qrcode.properties.QrCodeProperties;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@EnableConfigurationProperties({QrCodeProperties.class})
@Configuration
public class QrCodeStarterConfiguration {

    @ConditionalOnMissingBean
    @Bean
    public QrCodeGenerator qrCodeGenerator(QrCodeProperties qrCodeProperties){
        return new QrCodeGenerator(qrCodeProperties);
    }
}
